/* 博客页面容器 */
.blog-container {
  display: flex;
  position: absolute;
  align-items: center;
  justify-content: center;
  top: 0;
  left: 0;
  gap: 2rem;
  height: 100vh;
  margin-left: 0;
  width: 98vw;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
  padding: 2rem;
  background-color: #667eea;
}

/* 侧边栏 */
.blog-sidebar {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 1rem;
  padding-top: 5vh;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  height: 95vh;
  width: 15vw;
  min-width: 220px;
  position: sticky;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section h3 {
  margin: 0 0 1rem 0;
  color: #2d3748;
  font-size: 1.1rem;
  font-weight: 600;
}

/* 搜索框 */
.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: white;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 标签列表 */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-button {
  padding: 0.5rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: white;
  color: #4a5568;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tag-button:hover,
.tag-button.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-1px);
}

/* 统计信息 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.stat-item {
  text-align: center;
  padding: 0.75rem;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #667eea;
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: #718096;
}

/* 主内容区域 */
.blog-main {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  height: 95vh;
  width: 50vw;
  overflow-y: auto;
}

/* 文章列表 */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 90vh;
  
  overflow-y: auto;
  padding-right: 0.5rem;
}

.posts-grid::-webkit-scrollbar {
  display: none;
}

.posts-grid {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.post-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  width: 100%;
  cursor: pointer;
}

.post-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.post-title {
  margin: 0;
  color: #2d3748;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.post-date {
  color: #718096;
  font-size: 0.85rem;
  white-space: nowrap;
  margin-left: 1rem;
}

.post-summary {
  color: #4a5568;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tag {
  padding: 0.25rem 0.75rem;
  background: #edf2f7;
  color: #4a5568;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* 文章详情模态框 */
.post-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #718096;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-button:hover {
  background: #f7fafc;
  color: #2d3748;
}

.post-content {
  color: #2d3748;
  line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  color: #2d3748;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content code {
  background: #f7fafc;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: #1a202c;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .blog-container {
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }
  

  
  .posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 1024px) {
  .blog-container {
    grid-template-columns: 250px 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
  }
  
  .blog-sidebar {
    max-height: 75dvh;
  }
  
  .blog-main {
    max-height: 75dvh;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .post-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .post-date {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .blog-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .blog-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 1rem;
    order: -1;
  }
  
  .blog-main {
    max-height: none;
    height: auto;
  }
  
  .sidebar-section h3 {
    font-size: 1rem;
  }
  
  .search-input {
    font-size: 0.85rem;
  }
  
  .tag-button {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    margin: 0.5rem;
    padding: 1.25rem;
  }
}

@media (max-width: 640px) {
  .blog-container {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .blog-sidebar,
  .blog-main {
    padding: 1.25rem;
    border-radius: 12px;
  }
  
  .posts-grid {
    max-height: 65vh;
    gap: 1rem;
  }
  
  .post-card {
    padding: 1.25rem;
  }
  
  .post-title {
    font-size: 1.1rem;
  }
  
  .post-summary {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .blog-container {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .blog-sidebar,
  .blog-main {
    padding: 1rem;
    border-radius: 10px;
  }
  
  .sidebar-section {
    margin-bottom: 1.5rem;
  }
  
  .posts-grid {
    max-height: 60vh;
    gap: 0.75rem;
  }
  
  .post-card {
    padding: 1rem;
  }
  
  .post-header {
    gap: 0.25rem;
  }
  
  .post-title {
    font-size: 1rem;
    line-height: 1.3;
  }
  
  .post-date {
    font-size: 0.8rem;
  }
  
  .post-summary {
    font-size: 0.85rem;
    line-height: 1.5;
  }
  
  .post-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }
  
  .modal-content {
    margin: 0.25rem;
    padding: 1rem;
    border-radius: 12px;
  }
  
  .close-button {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.25rem;
  }
}

@media (max-width: 375px) {
  .blog-container {
    padding: 0.25rem;
  }
  
  .blog-sidebar,
  .blog-main {
    padding: 0.75rem;
    border-radius: 8px;
  }
  
  .post-card {
    padding: 0.75rem;
  }
  
  .post-title {
    font-size: 0.95rem;
  }
}